from config import configUtil
from log.aiDpsLog import logger
from flask import Flask, request
from interface.regular import regular

ai_dps_flask = Flask(__name__)
ai_dps_flask.register_blueprint(regular, url_prefix="/regular")

thread = None
pool = None


@ai_dps_flask.before_request
def logrequest():
    logger.info('%s' % (request.full_path))


if __name__ == '__main__':
    print('environment:%s' % (configUtil.environment))
    port = configUtil.readConfig("server", "server.port")
    ai_dps_flask.run(host='0.0.0.0', port=port)
